home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Snippets / Development Tools & Languages / AEGestalt / UInformationView.cp < prev    next >
Encoding:
Text File  |  1995-02-05  |  2.2 KB  |  94 lines  |  [TEXT/MPS ]

  1. //     UInformationView.cp 
  2. //     Copyright © 1991-92 by Apple Computer, Inc. All rights reserved.
  3. //    Kent Sandvik DTS
  4. //    This file contains all the TInformationView member functions, used
  5. //    for drawing information in the TInformationView view.
  6. //
  7. //    <1>        khs        1.0        First final version
  8.  
  9.  
  10. #ifndef __UINFORMATIONVIEW__
  11. #include "UInformationView.h"
  12. #endif
  13.  
  14.  
  15. //    Empty constructor - for avoiding ptabs in global data space
  16.  
  17. #undef Inherited
  18. #define Inherited TView
  19.  
  20. #pragma segment ARes
  21. DefineClass(TInformationView, TView);
  22.  
  23. TInformationView::TInformationView()
  24.  
  25. {
  26.     
  27.     fHasGestaltInfo = FALSE;
  28.  
  29.     fLabel1 = ".........";
  30.     fLabel2 = ".........";
  31.     fLabel3 = ".........";
  32.     fLabel4 = ".........";
  33.     fLabel5 = ".........";
  34.     fLabel6 = ".........";
  35.     fLabel7 = ".........";
  36.     fLabel8 = ".........";
  37.     fLabel9 = ".........";
  38.     fLabel10 = ".........";
  39.     fLabel11 = ".........";
  40.     fLabel12 = ".........";
  41. }
  42.  
  43.  
  44. //    draw the contents of the drawing object to screen
  45. #pragma segment ARes
  46. void TInformationView::Draw(const VRect& area)
  47. {
  48.     Inherited::Draw(area);
  49.     // draw the real thing!
  50.     this->DrawInformation();
  51. }
  52.  
  53.  
  54. #pragma segment ARes
  55. void TInformationView::DrawInformation()
  56. {
  57.     // Set font and font size
  58.     PenNormal();
  59.     TextFont(geneva);
  60.     TextSize(9);
  61.     TextFace(bold);
  62.  
  63.     // Draw Labels
  64.     MoveTo(kHorizontStart, kVerticalStart);
  65.     DrawString(fLabel1);
  66.     MoveTo(kHorizontStart, kVerticalStart + kVerticalOffset);
  67.     DrawString(fLabel2);
  68.     MoveTo(kHorizontStart, kVerticalStart + 2 * kVerticalOffset);
  69.     DrawString(fLabel3);
  70.     MoveTo(kHorizontStart, kVerticalStart + 3 * kVerticalOffset);
  71.     DrawString(fLabel4);
  72.     MoveTo(kHorizontStart, kVerticalStart + 4 * kVerticalOffset);
  73.     DrawString(fLabel5);
  74.     MoveTo(kHorizontStart, kVerticalStart + 5 * kVerticalOffset);
  75.     DrawString(fLabel6);
  76.     MoveTo(kHorizontStart, kVerticalStart + 6 * kVerticalOffset);
  77.     DrawString(fLabel7);
  78.     MoveTo(kHorizontStart, kVerticalStart + 7 * kVerticalOffset);
  79.     DrawString(fLabel8);
  80.     MoveTo(kHorizontStart, kVerticalStart + 8 * kVerticalOffset);
  81.     DrawString(fLabel9);
  82.     MoveTo(kHorizontStart, kVerticalStart + 9 * kVerticalOffset);
  83.     DrawString(fLabel10);
  84.     MoveTo(kHorizontStart, kVerticalStart + 10 * kVerticalOffset);
  85.     DrawString(fLabel11);
  86.     MoveTo(kHorizontStart, kVerticalStart + 11 * kVerticalOffset);
  87.     DrawString(fLabel12);
  88.  
  89.     // restore pen
  90.     PenNormal();
  91. }
  92.  
  93.  
  94.